package Thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

class OneThread implements Runnable{
    @Override
    public void run() {
        for (int i=1;i<10;i++){
            System.out.println("线程One:"+i);
        }
    }
}
class TwoThread implements Runnable{
    @Override
    public void run() {
        for (int i=1;i<10;i++){
            System.out.println("线程Two:"+i);
        }
    }
}

public class MyThreadPool {
    public static void main(String[] args) {
        ExecutorService service =  Executors.newFixedThreadPool(10);//容纳10个线程的线程池
        service.execute(new OneThread());
        service.execute(new TwoThread());
    }
}
